import { faker } from "@faker-js/faker";
import { createEffect, createSignal } from "solid-js";
import Button from "../components/Button";

export default function WatchDemo() {
  const [name, setName] = createSignal("watch demo");

  createEffect(() => {
    console.log("new name: ", name());
  });

  const changeName = () => {
    setName(faker.person.firstName());
  };

  return (
    <div>
      <Button onClick={changeName}>Change</Button>
      {name()}
    </div>
  );
}
